<?php

namespace tmcore\services\pay;

use tmcore\services\ConfigService;
use tmcore\traits\ErrorTrait;

abstract class BasePay
{
    use ErrorTrait;

    /**
     * 获取支付配置
     * @param string $identify alipay-支付宝 wechat-微信
     * @return array|bool|string
     */
    protected function getConfig($identify) {
        return (new ConfigService)->getConfig($identify,'pay');
    }

    /**
     * 统一下单
     * @param string $pay_for
     * @param array $params
     * @return mixed
     */
    abstract public function pay($pay_for, $params);
}